<div class="w">
    <ul class="service-list">
        <li class="li1">
            <?php echo $this->Html->image('/images/icon7.gif', array('width'=>'43','height'=>'61')) ?>
            <h4><?php echo $this->Html->link('移动设备界面设计', '/case/index/type:1')?></h4>
            <p>为基于多种系统平台及手机、电子阅读器、车载系统、平板电脑、MP4、等多种移动设备提供完整的用户界面解决方案。</p>
        </li>
        <li class="li2">
            <?php echo $this->Html->image('/images/icon8.gif', array('width'=>'65','height'=>'57')) ?>
            <h4><?php echo $this->Html->link('数码家电界面设计', '/case/index/type:2')?></h4>
            <p>提供触摸屏、数字电视等互动系统平台的用户界面设计服务，提供完善的解决方案。</p>
        </li>
        <li class="li3">
            <?php echo $this->Html->image('/images/icon9.gif', array('width'=>'61','height'=>'61')) ?>
            <h4><?php echo $this->Html->link('移动应用界面设计', '/case/index/type:3')?></h4>
            <p>基于IOS、Android、Windows Phone 8等系统平台的应用设计。</p>
        </li>
        <li class="li4">
            <?php echo $this->Html->image('/images/icon10.gif', array('width'=>'60','height'=>'51')) ?>
            <h4><?php echo $this->Html->link('软件界面设计', '/case/index/type:4')?></h4>
            <p>基于Windows、Mac OS等桌面操作系统的软件界面设计。提供品牌个性界面设计解决方案。</p>
        </li>
        <li class="li5">
            <?php echo $this->Html->image('/images/icon11.gif', array('width'=>'60','height'=>'50')) ?>
            <h4><?php echo $this->Html->link('网络平台界面设计', '/case/index/type:5')?></h4>
            <p>提供企业网站、产品页面、各类网游个性化网站以及SNS社交平台的界面设计服务。</p>
        </li>
        <li class="li6">
            <?php echo $this->Html->image('/images/icon12.gif', array('width'=>'59','height'=>'51')) ?>
            <h4><?php echo $this->Html->link('品牌形象设计', '/case/index/type:6')?></h4>
            <p>为客户提供品牌标识以及可定制化的VI设计。</p>
        </li>
    </ul>
    <div class="clr"></div>
    <div class="kh1">
        <label>填写您的设计需求：</label>我们将在收到需求后 <span>24小时</span> 内给您回复，您所提供的信息我们均会做保密处理。
    </div>
    <div class="service-form">
        <?php echo $this->Form->create('Feedback', array('url' => '/service/feedback'));?>
        <?php echo $this->Form->input('name', array('label'=>false,'class'=>'input1','placeholder'=>'您的姓名', 'div'=>false));?>
        <?php echo $this->Form->input('mail', array('label'=>false,'class'=>'input1','placeholder'=>'您的邮箱地址', 'div'=>false));?>
        <?php echo $this->Form->input('phone', array('label'=>false,'class'=>'input1','placeholder'=>'您的联系电话', 'div'=>false));?>
        <?php echo $this->Form->input('company', array('label'=>false,'class'=>'input1','placeholder'=>'公司名称', 'div'=>false));?>
        <?php echo $this->Form->input('company_website', array('label'=>false,'class'=>'input1','placeholder'=>'贵公司产品或网站地址', 'style'=>'width:592px', 'div'=>false));?>
        <?php echo $this->Form->text('description', array('label'=>false,'class'=>'input1','placeholder'=>'请在这里简要描述您的需求', 'rows'=>4,'cols'=>50,'style="width:742px;overflow:auto;height:90px;padding-top:8px"', 'div'=>false));?>
        <input type="image" src="<?php echo $this->Html->url('/images/n_send.png') ?>" height="101" width="159" alt="submit form">
        <?php echo $this->Form->end(); ?>
    </div>
    <div class="clr"></div>
    <div class="contactus">
        <?php echo $this->Html->image('/images/t_mail.gif', array('width'=>'229','height'=>'24')) ?>
        <?php
        echo $this->Html->link(
            $this->Html->image('/images/t_mail_link.gif',array('width'=>'155','height'=>'24')),
            "mailto:emirdesign@163.com",
                array('escape' => false)
            );
        ?>
        <?php echo $this->Html->image('/images/t_qq.gif', array('width'=>'113','height'=>'32','class'=>'qq')) ?>
        <?php
        echo $this->Html->link(
            $this->Html->image('/images/t_qq_link.gif',array('width'=>'78','height'=>'32')),
                "tencent://message/?uin=774533221&Site=jscj.com&Menu=yes",
                array('escape' => false)
            );
        ?>
    </div>  
</div>
<script type="text/javascript">

$(function() {
    var placeholderSupport = ("placeholder" in document.createElement("input"));
     
    if(!placeholderSupport){
        $("#FeedbackIndexForm .input1").val(function(){
            return this.placeholder;
        });
        //$(".service-form .input1").val('11');
        $("#FeedbackIndexForm .input1").blur(function(){
            if($(this).val()=="") {
                $(this).val(this.placeholder);
            }
        });
              
        $("#FeedbackIndexForm .input1").focus(function(){
            if ($(this).val()==this.placeholder) {
                $(this).val("");
            }
        });

    }

    var ajaxLoading = false;
    $('#FeedbackIndexForm').submit(function(){
        console.log(ajaxLoading);
        if (ajaxLoading) {
            return false; 
        }
        ajaxLoading = true;

        var pass = false;
        $("#FeedbackIndexForm .input1").each(function($i, $this){
            if ($.trim($(this).val()) == this.placeholder || $.trim($(this).val()) == '') {
                alert('请填写完整'); 
                this.focus();
                pass = false;
                return false;
            }
            pass = true;
        });
        if (pass) {
            $.post(this.action, $(this).serialize(), function(data){
                ajaxLoading = false;
                if (data == 'ok') {
                    alert("提交成功，我们会尽快联系你!"); 
                    return true;
                }
                data = $.parseJSON(data)
                for ( var i in data ) {
                    var message = data[i];
                    $.each(message, function(key, value){
                        alert(value);    
                    });
                }
            }); 
        } else {
            ajaxLoading = false;
        }

        return false;
    })
});
</script>
